Skip to content

KAFKA-14588: Move ConfigCommand to tools module#22013

Open
mimaison wants to merge 2 commits intoapache:trunkfrom
mimaison:kafka-14588
Open

KAFKA-14588: Move ConfigCommand to tools module#22013
mimaison wants to merge 2 commits intoapache:trunkfrom
mimaison:kafka-14588

Conversation

@mimaison
Copy link
Copy Markdown
Member

@mimaison mimaison commented Apr 9, 2026

Rewrite ConfigCommand in Java and move it to the tools module

Reviewers: Ken Huang s7133700@gmail.com

}

@ClusterTest(types = {Type.CO_KRAFT, Type.KRAFT})
public void testIntervalMsParser(ClusterInstance clusterInstance) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was moved to ConfigCommandIntegrationTest


val adminClient = adminClients.head
alterSslKeystoreUsingConfigCommand(sslProperties1, SecureExternal)
alterSslKeystore(sslProperties1, SecureExternal)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not see the point in using the tool instead of the Admin API

Rewrite ConfigCommand in Java and move it to the tools module
Copy link
Copy Markdown
Collaborator

@m1a2st m1a2st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch, left some comments

Comment on lines +517 to +520
boolean noMatchInResources = listGroupConfigResources(adminClient)
.map(resources -> resources.stream().noneMatch(resource -> resource.name().equals(name)))
.orElse(true);
if (noMatchInGroups && noMatchInResources) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semantics here don’t match the Scala version. .orElse(true) returns true when listGroupConfigResources is empty, whereas Scala’s .exists(...) returns false for an empty Option.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I agree this should be orElse(false)

* Alternatively, --user-defaults, --client-defaults, --broker-defaults, or --ip-defaults may be specified in place of
* --entity-type <users|clients|brokers|ips> --entity-default, respectively.
*/
class ConfigCommand {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be public class?

}
}


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line

@mimaison
Copy link
Copy Markdown
Member Author

Thanks @m1a2st for the review! I pushed an update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants